package com.atguigu.distributed.lock.designmode;

/**
 * 工厂模式所用
 */
public class FactoryPatternDemo {
    public static void main(String[] args) {
        ShapeFactory shapeFactory = new ShapeFactory();
        Shape circle = shapeFactory.getShape("CIRCLE");
        //调用circle的draw方法
        circle.draw();
        Shape rectangle = shapeFactory.getShape("RECTANGLE");
        //调用rectangle的draw方法
        rectangle.draw();
        Shape square = shapeFactory.getShape("SQUARE");
        //调用square的draw方法
        square.draw();

    }
}
